<?php
/**
 * Created by PhpStorm.
 * User: bolle
 * Date: 25.12.15
 * Time: 09:54
 */

namespace tbollmeier\alteraparser\syntaxgraph;


class GroupStartVertex extends Vertex
{
    public $name;
    public $id;
    private $group;

    public function __construct(VertexGroup $group)
    {
        parent::__construct(VertexCategory::GROUP_START);

        $this->group = $group;
        $this->name = null;
        $this->id = null;

    }

    public function numSuccessors()
    {
        if (!$this->group->isExpanded())
            $this->group->expand();

        return parent::numSuccessors();
    }

    public function nthSuccessor($idx)
    {
        if (!$this->group->isExpanded())
            $this->group->expand();

        return parent::nthSuccessor($idx);
    }

}